﻿using UnityEngine;
using System.Collections;

public class s_tankemove : MonoBehaviour {

    public float speed;
    private Rigidbody rigidbody;
    public float angleSpeed;

    // Use this for initialization
    void Start() {
        rigidbody = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void Update() {

    }

    void FixedUpdate()
    {
        float v = Input.GetAxis("Vertical1");
        rigidbody.velocity = transform.forward * v * speed;

        float h = Input.GetAxis("Horizontal1");
        rigidbody.angularVelocity = transform.up * angleSpeed * h;
    }
}
